package com.atguigu.spring.aop.anno;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author yanglin
 * @create 2023-12-12 15:53 星期二
 * description:
 */
public class TestAop {


    /**
     * 优先级越高的前置通知越先执行，后置通知越后执行
     * person 环绕之前......
     * person before....
     * user 环绕之前......
     * user before....
     * add....
     * user afterReturning......
     * user after.....
     * user 环绕之后......
     * person afterReturning......
     * person after.....
     * person 环绕之后......
     */
    @Test
    public void testAnnoAop(){
        ApplicationContext applicationContext = 
                new ClassPathXmlApplicationContext("./bean12.xml");
        AopUser aopUser = applicationContext.getBean("aopUser", AopUser.class);
        aopUser.add();
    }
    
}
